import { Module,NestModule,MiddlewareConsumer } from '@nestjs/common';
import { ListService } from './list.service';
import { ListController } from './list.controller';
import { logger } from 'src/middleware';
@Module({
  controllers: [ListController],
  providers: [ListService]
})
export class ListModule implements NestModule{
  configure(consumer: MiddlewareConsumer) {
    // consumer.apply(logger).forRoutes('list')  //拦截list路由
    consumer.apply(logger).forRoutes(ListController)  //拦截list路由
    // consumer.apply(logger).forRoutes({
    //   path: 'user',
    //   method:RequestMethod.GET    //拦截list  的get请求
    // })
  }}
